home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / examples.lha / examples / ris8 / t_bigbufF.f < prev    next >
Encoding:
Text File  |  1991-01-09  |  1.1 KB  |  43 lines

  1.  
  2.       program t_bigbuf
  3.  
  4. C
  5. C Program to test d8gimg when buffers are larger than image
  6. C
  7. C Input file:  h200x150.hdf (in "files" directory)
  8. C Output file: new.hdf
  9. C
  10.  
  11. C****||************************************************************
  12.       integer d8gdims, d8gimg
  13.       integer width, height, ispal, ret
  14.       integer bufwidth, bufheight
  15.  
  16.       character*1 image(500,400)
  17.       character*1 newimage(200,150)
  18.       character*1 pal(768)
  19.  
  20.       parameter (bufwidth  = 500,
  21.      *           bufheight = 400)
  22.  
  23. C****||**** read in image into "too large" array ******************
  24.       print *,'1'
  25.       ret = d8gdims('h200x150.hdf', width, height, ispal)
  26.       if ( ret .lt. 0) print *, 'Error opening file h200x150.hdf.'
  27.       ret = d8gimg('h200x150.hdf', image,bufwidth,bufheight,pal)
  28.       print *, 'width=',width,'   height=',height
  29.  
  30. C****||**** copy image to an array that is the "right size" *******
  31.       do 100 i=1,200
  32.           do 100 j=1,150
  33.               newimage(i,j) = image(i,j)
  34.   100 continue
  35.  
  36. C****||*** write newimage to different file -- should be the same ***
  37.       ret = d8pimg('new.hdf', newimage, width, height, ispal)
  38.  
  39.       stop
  40.       end
  41.  
  42.  
  43.